import dayjs from 'dayjs'

export function pointTwo (data) {
  if (String(data).indexOf('.') !== -1) { // 如果有小数点
    data = data.substring(0, data.indexOf('.') + 3)
  }
  return data
}

export function formattingTime (time, format = 'YYYY/MM/DD') {
  const data = dayjs(time).format(format)
  return data
}
